<!--
 * @Author: your name
 * @Date: 2020-05-04 20:09:41
 * @LastEditTime: 2020-05-05 16:12:41
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: \source\pages\code\DBLink\search.vue
 -->
<template>
  <Form ref="form" :model="condition" :label-width="90">
    <Row>
      <Col :span="12" :v-if="condition.id.show">
        <FormItem :label="$t('id')" prop="id">
          <Input v-model="condition.id.value"></Input>
        </FormItem>
      </Col>
      <Col :span="12" :v-if="condition.name.show">
        <FormItem :label="l('name')" prop="name">
          <Input v-model="condition.name.value"></Input>
        </FormItem>
      </Col>
      <Col :span="12" :v-if="condition.link.show">
        <FormItem :label="l('link')" prop="link">
          <Input v-model="condition.link.value"></Input>
        </FormItem>
      </Col>
      <Col :span="12" :v-if="condition.dbType.show">
        <FormItem :label="l('dbType')" prop="dbType">
          <Input v-model="condition.dbType.value"></Input>
        </FormItem>
      </Col>
      <Col :span="24" :v-if="condition.note.show">
        <FormItem :label="l('note')" prop="note">
          <Input v-model="condition.note.value"></Input>
        </FormItem>
      </Col>
      <Col :span="12" :v-if="condition.creationTime.show">
        <FormItem :label="l('creationTime')" prop="creationTime">
          <DatePicker type="daterange" v-model="condition.creationTime.value"></DatePicker>
        </FormItem>
      </Col>
      <Col :span="12" :v-if="condition.creatorUserId.show">
        <FormItem :label="l('creatorUserId')" prop="creatorUserId">
          <Input v-model="condition.creatorUserId.value"></Input>
        </FormItem>
      </Col>
      <Col :span="12" :v-if="condition.lastModificationTime.show">
        <FormItem :label="l('lastModificationTime')" prop="lastModificationTime">
          <DatePicker type="daterange" v-model="condition.lastModificationTime.value"></DatePicker>
        </FormItem>
      </Col>
      <Col :span="12" :v-if="condition.lastModifierUserId.show">
        <FormItem :label="l('lastModifierUserId')" prop="lastModifierUserId">
          <Input v-model="condition.lastModifierUserId.value"></Input>
        </FormItem>
      </Col>
    </Row>
  </Form>
</template>
<script>
import Api from "./api";
export default {
  name: "Add",
  data() {
    return {
      condition: {
        id: { op: "Equal", value: null, show: true },
        name: { op: "Equal", value: null, show: true },
        link: { op: "Equal", value: null, show: true },
        dbType: { op: "Equal", value: null, show: true },
        note: { op: "Equal", value: null, show: true },
        creationTime: { op: "Range", value: null, show: true },
        creatorUserId: { op: "Equal", value: null, show: true },
        lastModificationTime: { op: "Range", value: null, show: true },
        lastModifierUserId: { op: "Equal", value: null, show: true }
      }
    };
  },
  methods: {
    handleClose() {
      this.$emit("on-close");
    },
    l(key) {
      let vkey = "DBLink" + "." + key;
      if (vkey == this.$t(vkey)) {
        return this.$t(key);
      } else {
        return this.$t(vkey);
      }
    }
  }
};
</script>